import request from '@/utils/request'
import { tradeApi } from '@/utils/comm'

// 查询服务售后单列表
export function listServerAfterSale(query) {
  return request({
    url: `${tradeApi}/serverAfterSale/list`,
    method: 'get',
    params: query
  })
}

// 查询服务售后单详细
export function getServerAfterSale(id) {
  return request({
    url: `${tradeApi}/serverAfterSale/` + id,
    method: 'get'
  })
}

// 通过审核
export function approve(data) {
  return request({
    url: `${tradeApi}/serverAfterSale/approve`,
    method: 'put',
    data
  })
}

// 驳回申请
export function reject(data) {
  return request({
    url: `${tradeApi}/serverAfterSale/reject`,
    method: 'put',
    data
  })
}

// 重新转账
export function retryTransfer(data) {
  return request({
    url: `${tradeApi}/serverAfterSale/refundNotify`,
    method: 'post',
    data
  })
}